﻿using System;
using System.Windows.Forms;

namespace ThreadSafeControls {
    partial class ThreadSafeCheckedListBox {
        public class ObjectCollection : ThreadSafeListBox<CheckedListBox>.ObjectCollectionBase {
            
            internal ObjectCollection(ThreadSafeCheckedListBox listBox) : base(listBox) { }

            public int Add(object item, bool isChecked) {
                return _listBox.ReturnAsync<int>(c => c.Items.Add(item, isChecked));
            }

            public int Add(object item, CheckState checkState) {
                return _listBox.ReturnAsync<int>(c => c.Items.Add(item, checkState));
            }
            
        }
    }
}
